package com.haiertvbic.tvnow.adapter;

import java.util.ArrayList;

import android.content.Context;
import android.text.Html;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.haiertvbic.tvnow.R;

public class ActotDetailAdapter extends BaseAdapter {
	private ArrayList<String> strs;
	private Context context;

	public ActotDetailAdapter(ArrayList<String> strs, Context context) {
		this.strs = strs;
		this.context = context;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return strs.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		TextView childName;
		if (convertView == null) {
			convertView = View.inflate(context, R.layout.layout_actor_resume,
					null);
			childName = (TextView) convertView.findViewById(R.id.actor_resume);
			convertView.setTag(childName);
		} else {
			childName = (TextView) convertView.getTag();
		}
		if (strs.size() == 1) {
			childName.setText(Html.fromHtml(strs.get(position)));
		} else {
			childName.setText(strs.get(position));
		}
		return convertView;
	}

}
